package Classwork;


    class Person
    {
        private String name;
        private int age;
        public Person(){
            System.out.println("调用了方法Person");
        }
        public void setNameAge(String name,int age){
         this.age=age;
         this.name=name;
        }
        public void show(){
            System.out.println("姓名："+name+" 年龄："+age);
        }
    }
    class Student extends Person{
        private String department;
        public Student(){
            System.out.println("调用了方法Student");
        }
        public void setDepartment(String dep){
            department=dep;
            System.out.println("是"+department+"学生");
        }
    }
    public class Jichen01{
        public static void main(String[] args) {
            Student stu=new Student();
            stu.setNameAge("zty",18);
            stu.show();
            stu.setDepartment("rjj");
        }
}
